#ifndef QTOOLMENU_H
#define QTOOLMENU_H

#ifdef COMMONCTRL_LIB
# define COMMONCTRL_EXPORT Q_DECL_EXPORT
#else
# define COMMONCTRL_EXPORT Q_DECL_IMPORT
#endif

#include <QWidget>

class QPrivateData;
class QLabelEx;
class COMMONCTRL_EXPORT QToolMenu : public QWidget
{
	Q_OBJECT

public:
	QToolMenu(QWidget *parent);
	~QToolMenu();

	void			addLevelOneMenuList(const QStringList&);
	void			addLevelTwoMenuList(int,const QStringList&);
	void			setLevelOneMenuIcon(int ,const QString& strPicName);
	void			insertLevelOneMenu(int ,const QString& );
	void			appendLevelOneMenu(const QString& );
	void			removeLevelOneMenu(int );
	int				getLevelOneMenuCount();
	int				getLevelTwoMenuCount(int);
	QWidget*		findLevelOneMenu(int);
	QLabelEx*		findLevelTwoMenu(int,int);
	bool			hasLevelTwoMenu(int);
	void			createLayout(Qt::Alignment nAlignment = Qt::AlignHCenter);
	void			setDefaultMenuIndex(int);
	bool			addActionWidget(int,int,QWidget*);
	bool			addActionWidget(int,int,int);
	//bool			addActionWidgets(const QMap<QString,QWidget*>&);

protected:
	void			hideAllLabelGroup();
	void			showOneLabelGroup(int );
	void			setLevelOneMenuSelected(int);

	protected slots:
		void			onChangeLevelTwoMenuSlot(int);

private:

	QPrivateData*		m_pPrivateData;
signals:
	void			onOpenTabWidgetSignal(QWidget*);
	void			onOpenTabIndexSignal(int);
};

#endif // QTOOLMENU_H
